class A  {
    String name;
    void shout(){
        System.out.println("动物发出叫声");
    }
}

class Dog extends A{
    public void printName() {
        System.out.println("狗发出了叫声");
    }
}
public class Demo {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name="沙皮狗";
        dog.printName();
        dog.shout();
    }
}
